#include "..\\STM32Lib\\stm32f10x.h"
#include "..\\UCOSII\\ucos_ii.h"
#include "tim.h"
#include "system.h"
#include "gpio.h"
#include "action.h"

void func_findzero(PWMATTR *Pwm)
{
	Pwm->HightTime = MOTOR1FINDZEROSPEED(3);
	Pwm->LowTime = MOTOR1FINDZEROSPEED(3);
	Pwm->TotalCntOfPwm = PWM_Infinit;
	Pwm->PwmIndex_Cur = 0;
}

s32 Action(MOTOR *pMotor)
{
	switch(pMotor->CurStatus)
	{
		case FindZero:
		{
			GPIO_ENABLEINTTRUPT(GPIO_Pin_11);
			func_findzero(&(pMotor->pMotorPwmStatus));
			pMotor->RunDirection = FORWARD;
			(*(pMotor->pFucMotorEnble))();
			break;
		}
		case GoToSomeWhere:
		{
			
			break;
		}
		default:
		{			
			break;
		}
	}

	return 0;
}



